home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
526-550
/
disk_540
/
browser
/
browserii_src.lzh
/
Startup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-05-08
|
2KB
|
79 lines
/*
* Startup.c - Copyright © 1991 by S.R. & P.C.
*
* Created: 18 Feb 1991 11:36:37
* Modified: 01 May 1991 21:16:55
*
* Make>> make
*/
extern struct ParMBase *ParMBase;
extern struct ExecBase *SysBase;
extern struct ArpBase *ArpBase;
extern struct GfxBase *GfxBase;
extern struct IntuitionBase *IntuitionBase;
extern struct IconBase *IconBase;
extern struct LayersBase *LayersBase;
extern struct ReqLib *ReqBase;
extern struct Process *MainProcess;
extern struct WBStartup *WBenchMsg;
long DosWrite(BPTR file, char *buffer, long length);
#pragma amicall(DOSBase, 0x30, DosWrite(d1,d2,d3))
void main(void);
void exit(int code)
{
if (WBenchMsg)
{
Forbid();
ReplyMsg((struct Message *)WBenchMsg);
}
CloseLibrary(ParMBase);
Exit(code);
}
void _main(long alen, char *aptr)
{
struct Library *DOSBase;
register struct Process *pp;
MainProcess = pp = (struct Process *)SysBase->ThisTask;
if (!pp->pr_CLI) {
WaitPort(&pp->pr_MsgPort);
WBenchMsg = (struct WBStartup *)GetMsg(&pp->pr_MsgPort);
}
if (!(ParMBase = (struct ParMBase *)OpenLibrary("parm.library",1L))) {
if (pp->pr_CLI && (DOSBase = OpenLibrary("dos.library",0L))) {
DosWrite(pp->pr_COS, "You need parm.library V1+\n", 26L);
DosWrite(pp->pr_COS, "You need arp.library V39+\n", 26L);
CloseLibrary(DOSBase);
}
if (WBenchMsg) {
Forbid();
ReplyMsg((struct Message *)WBenchMsg);
}
return;
}
ArpBase = ParMBase->ArpBase;
ReqBase = ParMBase->ReqBase;
IconBase = ParMBase->IconBase;
LayersBase = ParMBase->LayersBase;
IntuitionBase = (struct IntuitionBase *)ArpBase->IntuiBase;
GfxBase = (struct GfxBase *)ArpBase->GfxBase;
if (WBenchMsg)
CurrentDir(WBenchMsg->sm_ArgList->wa_Lock);
main();
exit(0);
}